﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsControlLibrary1
{
    public partial class TextBoxControl : UserControl
    {
        public TextBoxControl()
        {
            InitializeComponent();
        }
        private string actualValue;
        public string ActualValue
        {
            get { return actualValue; }
            set
            {
                actualValue = value;
                lbl_data.Text = actualValue;
            }
        }

        private string unit;
        public string Unit
        {
            get { return unit; }
            set
            {
                unit = value;
                lbl_unit.Text = unit;
            }
        }

        public delegate void BtnClickDelegate(object sender, EventArgs e);
        public event BtnClickDelegate userBtnClick;

        private void lbl_data_DoubleClick(object sender, EventArgs e)
        {
            if (userBtnClick!= null)
            {
                userBtnClick(sender, new EventArgs());//按钮自身作为参数传进
            }
        }
    }
}
